#ifndef Defs_h
#define Defs_h

#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <httpfilt.h>
#include <httpext.h>
#include <stdio.h>
#include <stdlib.h>
#include <crtdbg.h>
#include <new>

#define LOG_DIRECTORY					"LogFiles"
#define LOG_FILENAME					"%s.%d%d%d.%d.log"
#define LOG_TEMPLATE					"#Software: KodeIT IisShield 2.2.1\r\n#Date: %d-%d-%d %d:%d:%d\r\n#Fields: date time c-ip c-port s-ip s-port rules reason winerr reqline\r\n"
#define TRACE_TEMPLATE					"#Software: KodeIT IisShield 2.2.1\r\n#Date: %d-%d-%d %d:%d:%d\r\n#Fields: date time reason\r\n"

#define TXT_ERR_NONE					"ERR_NONE"
#define TXT_ERR_REQUEST_FORMAT			"ERR_REQUEST_FORMAT"
#define TXT_ERR_VERB_ALLOWED			"ERR_VERB_ALLOWED"
#define TXT_ERR_VERB_DENIED				"ERR_VERB_DENIED"
#define TXT_ERR_SCHEMA_FORMAT			"ERR_SCHEMA_FORMAT"
#define TXT_ERR_URL_MAXLEN				"ERR_URL_MAXLEN"
#define TXT_ERR_URL_FIRSTBYTE			"ERR_URL_FIRSTBYTE"
#define TXT_ERR_URL_CANON_CHANGE		"ERR_URL_CANON_CHANGE"
#define TXT_ERR_URL_DOT_NOEXT			"ERR_URL_DOT_NOEXT"
#define TXT_ERR_URL_EXTALLOWED			"ERR_URL_EXTALLOWED"
#define TXT_ERR_URL_EXTDENIED			"ERR_URL_EXTDENIED"
#define TXT_ERR_URL_HIGHBIT				"ERR_URL_HIGHBIT"
#define TXT_ERR_URL_CTL					"ERR_URL_CTL"
#define TXT_ERR_URL_SEQ					"ERR_URL_SEQ"
#define TXT_ERR_QUERY_SEQ				"ERR_QUERY_SEQ"
#define TXT_ERR_QUERY_HIGHBIT			"ERR_QUERY_HIGHBIT"
#define TXT_ERR_QUERY_CTL				"ERR_QUERY_CTL"
#define TXT_ERR_QUERY_MAXLEN			"ERR_QUERY_MAXLEN"
#define TXT_ERR_QUERY_CANON_CHANGE		"ERR_QUERY_CANON_CHANGE"
#define TXT_ERR_VERSION_FORMAT			"ERR_VERSION_FORMAT"
#define TXT_ERR_HEADER_NOCOLON			"ERR_HEADER_NOCOLON"
#define TXT_ERR_HEADERNAME_MAXLEN		"ERR_HEADERNAME_MAXLEN"
#define TXT_ERR_HEADERVALUE_MAXLEN		"ERR_HEADERVALUE_MAXLEN"
#define TXT_ERR_HEADERNAME_FORMAT		"ERR_HEADERNAME_FORMAT"
#define TXT_ERR_HEADERVALUE_FORMAT		"ERR_HEADERVALUE_FORMAT"
#define TXT_ERR_HEADER_FORMAT			"ERR_HEADER_FORMAT"
#define TXT_ERR_HEADER_HOST				"ERR_HEADER_HOST"
#define TXT_ERR_HEADER_CONTENTLENGTH	"ERR_HEADER_CONTENTLENGTH"
#define TXT_ERR_CONTENTHEADER_MAXVALUE	"ERR_CONTENTHEADER_MAXVALUE"
#define TXT_ERR_MAXLENBYHEADER			"ERR_MAXLENBYHEADER"
#define TXT_ERR_PAYLOAD_MAXLEN			"ERR_PAYLOAD_MAXLEN"
#define TXT_ERR_PAYLOAD_HIGHBIT			"ERR_PAYLOAD_HIGHBIT"
#define TXT_ERR_WINDOWS					"ERR_WINDOWS"

#define ALLOC(n)					HeapAlloc(GetProcessHeap(), 0, n)
#define REALLOC(p,n)				HeapReAlloc(GetProcessHeap(), 0, p, n)
#define FREE(p)						HeapFree(GetProcessHeap(), 0, p)

void ODS(const char * sz, ...);

#include "Exception.h"
#include "Trace.h"
#include "Memory.h"
#include "Timer.h"
#include "Buffer.h"
#include "String.h"
#include "List.h"
#include "File.h"
#include "CriticalSection.h"

#endif //Defs_h